<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<html>
<body>
<script type="text/javascript">

	function doSubmit(action){
		if(action != 0){
			$("#action").val(action);
			if(action == 1){
				$("#roomId").val(0);
			} 
		}
		if($("#roomName").val() == "" || $("#desc").val() == ""){
			alert("输入值不能为空");
			return;
		}
		$("#form1").submit();
	}
	
</script>

<jsp:include page="_room_header.jsp"></jsp:include>
<form action="dzlist.do" method="post" id="form1">

	<table>
		<tr>
			<td><span id="roomIdSpan"> 房间id </span></td>
			<td><input type="text" value="${roomId}" name="roomId" id="roomId" /></td>
			<td><label class="control-label" for="sendtime">创建时间 :</label></td>
			<td>
				<div class="controls">
					<div class="input-append datepicker" id="datetimepicker"   pickTime=true >
					    <input data-format="yyyy-MM-dd" type="text" name="createTime" id="createTime" value="${createTime}"></input>
					    <span class="add-on">
					      <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
					    </span>
				  	</div>		 
				</div>
			</td>
			<td>房间类型:
				<select id="sceneType" name="sceneType">
					<option value="-1" selected="selected">=请选择=</option>
			        <option value="1" >1-K歌房</option>
			        <option value="3">3-活动房</option>
				</select>
			</td>
			<td><input type="submit" class="btn"  value="查询"></input> </td>
		</tr>
		<tr>
			<td>
				房间总数:  
			</td>
			<td>
				<div style="color:red;">${allcount}</div>
			</td>
		</tr>
	</table>
	
	
	
</form>

<table class="table table-bordered">
  <thead>
    <tr>
      <th>序号</th>
      <th>ID</th> 
      <th>名称</th>
      <th>样式</th>
      <th>房主</th>
      <th>创建时间</th>
      <th>到期时间</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
  <c:forEach var="room" items="${list}" varStatus="rooms" >
    <tr>
   	  <td>${rooms.count}</td>
      <td>${room.roomId}</td>
      <td>${room.name}</td>
      <td>${room.style}</td>
      <td><tags:user id="${room.playerId}"/></td>
      <td>${room.createDate}</td>
      <td>${room.expiredAt}</td>
      <td>
      	<a href="blackRoom.do?roomId=${room.roomId}&status=1">加入黑名单</a>
      	<a href="?delete=${room.roomId}&roomName=${room.name}" onclick="return window.confirm('确认删除 ${room.roomId} ${room.name}');">删除</a>
      	<a href="?dissovle=${room.roomId}&ownerId=${room.playerId }&roomName=${room.name}" onclick="return window.confirm('确认解散${room.roomId} ${room.name}');">解散</a>
      </td>
    </tr>
  </c:forEach>
  </tbody>
</table>
</body>
</html>